import java.util.Arrays;

public class Experiment4 {


    public static int[] arrays(int []arrays){
        int s=0;
        int D=arrays.length-1;
while (s<D) {
    while(s<D&&arrays[s]%2!=0){
        s++;
    }
    //s走完一定是奇数

    while (s<D&&arrays[D]%2==0){
        D--;
    }//D下标走完一定是偶数
     int temp=arrays[s];
    arrays[s]=arrays[D];
    arrays[D]=temp;


}
return arrays;
    }
    public static void main(String []arges){
        System.out.println("哈哈老子写代码了");
        int []a=new int[]{1,2,3,4,5,6,7,8};
        int []d=arrays(a);
        System.out.println(Arrays.toString(d));

    }
}
